package com.ikas.ai.server.parse.model;

import lombok.Data;
import org.apache.commons.compress.utils.Lists;

import java.util.List;

/**
 * @Description: 解析excel的风险巡检元数据
 * @Author: qi.yilai
 * @Date: 2023/6/26 10:40
 * @Version: 1.0.0
 **/
@Data
public class RiskInspectMetaData {

    private String systemName;

    private List<RiskEquipmentMetaData> equipments = Lists.newArrayList();

    public boolean containEquipment(String equipmentName) {
        for (RiskEquipmentMetaData equip: equipments) {
            if (equip.getEquipName().equals(equipmentName)) {
                return true;
            }
        }
        return false;
    }

    public RiskEquipmentMetaData getEquipment(String equipmentName) {
        for (RiskEquipmentMetaData equip: equipments) {
            if (equip.getEquipName().equals(equipmentName)) {
                return equip;
            }
        }
        return null;
    }

    public void addEquipment(RiskEquipmentMetaData riskEquipmentMetaData) {
        equipments.add(riskEquipmentMetaData);
    }
}
